package com.myboot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 新增自定义静态资源映射
 * Created by liuhuan on 2017/1/11.
 */
@Configuration
public class MyWebMvcConfigureAdapter extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**").addResourceLocations("classpath:/myres/");
        super.addResourceHandlers(registry);
    }
}
